//创建题型的控制器JS
msqbapp.controller('tixingController',function ($scope,msqbService) {
    $scope.userId = 0;
    $scope.classifyId = 0;
    //创建新题的初始化函数
    $scope.tixingInit = function () {
        var arr = window.location.search.split('&');
        for (var i = 0;i<arr.length;i++){
            var strarr = arr[i].split('=');
            if(strarr[0]=='?userId'){
                $scope.userId = strarr[1];
            }
            if(strarr[0]=='classifyId'){
                $scope.classifyId = strarr[1];
            }
        }
        //得到题型列表
        msqbService.getTopicTypeNumList($scope.classifyId).success(function (resp) {
            $scope.TopicTypeNumList = resp;
        });
    };
    //具体题型的点击事件
    $scope.totopicList=function (topictypeid) {
        //单选
        if(topictypeid==1){
            window.open("danxuan.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&topictypeid="+topictypeid);
        };
        //多选
        if(topictypeid==2){
            window.open("duoxuanliebiao.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&topictypeid="+topictypeid);
        };
        //判断
        if(topictypeid==3){
            window.open("panduanliebiao.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&topictypeid="+topictypeid);
        }
        //填空
        if(topictypeid==4){
            window.open("tiankongliebiao.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&topictypeid="+topictypeid);
        }
        //简答
        if(topictypeid==5){
            window.open("jiandaliebiao.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&topictypeid="+topictypeid);
        }
    }
});